<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="robots" content="noodp" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
        <title>远程Linux服务器使用 - Pour l&#39;honneur de l&#39;esprit humain.</title><meta name="Description" content=""><meta property="og:title" content="远程Linux服务器使用" />
<meta property="og:description" content="最近要开始做一个关于 NLP 的项目 Github Organization，项目方给我们提供了服务器远程访问，仔细想来也是我第一次真正完全使用无界面的 Linux (WSL" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://feiyuxiaoThu.github.io/posts/%E8%BF%9C%E7%A8%8Blinux%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BD%BF%E7%94%A8/" /><meta property="article:section" content="posts" />
<meta property="article:published_time" content="2020-06-30T00:00:00+00:00" />
<meta property="article:modified_time" content="2020-06-30T00:00:00+00:00" />

<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="远程Linux服务器使用"/>
<meta name="twitter:description" content="最近要开始做一个关于 NLP 的项目 Github Organization，项目方给我们提供了服务器远程访问，仔细想来也是我第一次真正完全使用无界面的 Linux (WSL"/>
<meta name="application-name" content="LoveIt">
<meta name="apple-mobile-web-app-title" content="LoveIt"><meta name="theme-color" content="#ffffff"><meta name="msapplication-TileColor" content="#da532c"><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
        <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
        <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"><link rel="manifest" href="/site.webmanifest"><link rel="canonical" href="http://feiyuxiaoThu.github.io/posts/%E8%BF%9C%E7%A8%8Blinux%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BD%BF%E7%94%A8/" /><link rel="prev" href="http://feiyuxiaoThu.github.io/posts/%E7%94%B5%E5%8A%A8%E5%8C%96%E6%90%85%E5%8A%A8%E4%B8%80%E6%B1%A0%E6%98%A5%E6%B0%B4%E6%88%91%E7%9C%8B%E7%89%B9%E6%96%AF%E6%8B%89%E8%B7%83%E5%B1%85%E5%B8%82%E5%80%BC%E7%AC%AC%E4%B8%80/" /><link rel="next" href="http://feiyuxiaoThu.github.io/posts/%E8%B0%88%E8%B0%88kmt%E5%92%8C%E4%B9%9D%E4%BA%8C%E5%85%B1%E8%AF%86/" /><link rel="stylesheet" href="/lib/normalize/normalize.min.css"><link rel="stylesheet" href="/css/style.min.css"><link rel="stylesheet" href="/lib/fontawesome-free/all.min.css"><link rel="stylesheet" href="/lib/animate/animate.min.css"><script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "headline": "远程Linux服务器使用",
        "inLanguage": "zh-CN",
        "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "http:\/\/feiyuxiaoThu.github.io\/posts\/%E8%BF%9C%E7%A8%8Blinux%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BD%BF%E7%94%A8\/"
        },"genre": "posts","keywords": "Linux, vscode","wordcount":  561 ,
        "url": "http:\/\/feiyuxiaoThu.github.io\/posts\/%E8%BF%9C%E7%A8%8Blinux%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BD%BF%E7%94%A8\/","datePublished": "2020-06-30T00:00:00+00:00","dateModified": "2020-06-30T00:00:00+00:00","publisher": {
            "@type": "Organization",
            "name": "辛载阳"},"author": {
                "@type": "Person",
                "name": "辛载阳"
            },"description": ""
    }
    </script></head>
    <body header-desktop="fixed" header-mobile="auto"><script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '' === 'dark')) && document.body.setAttribute('theme', 'dark');</script>

        <div id="mask"></div><div class="wrapper"><header class="desktop" id="header-desktop">
    <div class="header-wrapper">
        <div class="header-title">
            <a href="/" title="Pour l&#39;honneur de l&#39;esprit humain.">Pour l&#39;honneur de l&#39;esprit humain</a>
        </div>
        <div class="menu">
            <div class="menu-inner"><a class="menu-item" href="/posts/"> 文章 </a><a class="menu-item" href="/tags/"> 标签 </a><a class="menu-item" href="/categories/"> 分类 </a><a class="menu-item" href="/publication" title="Publication"> 论文 </a><a class="menu-item" href="/projects" title="Projects"> 项目 </a><a class="menu-item" href="https://www.linkedin.com/in/feiyuxiao/" title="CVpdf" rel="noopener noreffer" target="_blank"> 关于 </a><span class="menu-item delimiter"></span><span class="menu-item search" id="search-desktop">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-desktop">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="搜索">
                            <i class="fas fa-search fa-fw"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-desktop" title="清空">
                            <i class="fas fa-times-circle fa-fw"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-desktop">
                            <i class="fas fa-spinner fa-fw fa-spin"></i>
                        </span>
                    </span><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                    <i class="fas fa-adjust fa-fw"></i>
                </a>
            </div>
        </div>
    </div>
</header><header class="mobile" id="header-mobile">
    <div class="header-container">
        <div class="header-wrapper">
            <div class="header-title">
                <a href="/" title="Pour l&#39;honneur de l&#39;esprit humain.">Pour l&#39;honneur de l&#39;esprit humain</a>
            </div>
            <div class="menu-toggle" id="menu-toggle-mobile">
                <span></span><span></span><span></span>
            </div>
        </div>
        <div class="menu" id="menu-mobile"><div class="search-wrapper">
                    <div class="search mobile" id="search-mobile">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-mobile">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="搜索">
                            <i class="fas fa-search fa-fw"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-mobile" title="清空">
                            <i class="fas fa-times-circle fa-fw"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-mobile">
                            <i class="fas fa-spinner fa-fw fa-spin"></i>
                        </span>
                    </div>
                    <a href="javascript:void(0);" class="search-cancel" id="search-cancel-mobile">
                        取消
                    </a>
                </div><a class="menu-item" href="/posts/" title="">文章</a><a class="menu-item" href="/tags/" title="">标签</a><a class="menu-item" href="/categories/" title="">分类</a><a class="menu-item" href="/publication" title="Publication">论文</a><a class="menu-item" href="/projects" title="Projects">项目</a><a class="menu-item" href="https://www.linkedin.com/in/feiyuxiao/" title="CVpdf" rel="noopener noreffer" target="_blank">关于</a><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                <i class="fas fa-adjust fa-fw"></i>
            </a></div>
    </div>
</header>
<div class="search-dropdown desktop">
    <div id="search-dropdown-desktop"></div>
</div>
<div class="search-dropdown mobile">
    <div id="search-dropdown-mobile"></div>
</div>
<main class="main">
                <div class="container"><div class="toc" id="toc-auto">
            <h2 class="toc-title">目录</h2>
            <div class="toc-content" id="toc-content-auto"></div>
        </div><article class="page single"><h1 class="single-title animated flipInX">远程Linux服务器使用</h1><div class="post-meta">
            <div class="post-meta-line"><span class="post-author"><a href="/" title="Author" rel=" author" class="author"><i class="fas fa-user-circle fa-fw"></i>辛载阳</a></span>&nbsp;<span class="post-category">收录于 <a href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA/"><i class="far fa-folder fa-fw"></i>计算机</a></span></div>
            <div class="post-meta-line"><i class="far fa-calendar-alt fa-fw"></i>&nbsp;<time datetime="2020-06-30">2020-06-30</time>&nbsp;<i class="fas fa-pencil-alt fa-fw"></i>&nbsp;约 561 字&nbsp;
                <i class="far fa-clock fa-fw"></i>&nbsp;预计阅读 2 分钟&nbsp;</div>
        </div><div class="details toc" id="toc-static"  kept="">
                <div class="details-summary toc-title">
                    <span>目录</span>
                    <span><i class="details-icon fas fa-angle-right"></i></span>
                </div>
                <div class="details-content toc-content" id="toc-content-static"><nav id="TableOfContents">
  <ul>
    <li><a href="#配置-vscode-remote">配置 Vscode remote</a></li>
    <li><a href="#安装-pytorch">安装 Pytorch</a></li>
    <li><a href="#接下来计划">接下来计划</a></li>
  </ul>
</nav></div>
            </div><div class="content" id="content"><p>最近要开始做一个关于 NLP 的项目 <a href="https://github.com/BigDataPractice2020" target="_blank" rel="noopener noreffer">Github Organization</a>，项目方给我们提供了服务器远程访问，仔细想来也是我第一次真正完全使用无界面的 Linux (WSL也算？之前用的比较多的还是 Ubuntu 装在虚拟机里面)，记录一些有趣的点。</p>
<p>访问是挂了 VPN 之后使用 Xshell ssh 方式访问，我进去一看是个空服务器，于是我先配置了 Anaconda 和 Pytorch ，Anaconda 装倒是没啥问题，倒是现在 Pip 都要使用 &ndash;user 选项。</p>
<h2 id="配置-vscode-remote">配置 Vscode remote</h2>
<p><img
        class="lazyload"
        src="/svg/loading.min.svg"
        data-src="https://img-blog.csdnimg.cn/20191128143221179.png"
        data-srcset="https://img-blog.csdnimg.cn/20191128143221179.png, https://img-blog.csdnimg.cn/20191128143221179.png 1.5x, https://img-blog.csdnimg.cn/20191128143221179.png 2x"
        data-sizes="auto"
        alt="https://img-blog.csdnimg.cn/20191128143221179.png"
        title="https://img-blog.csdnimg.cn/20191128143221179.png" /></p>
<p>主要参考 <a href="https://www.cnblogs.com/WindSun/p/12142621.html" target="_blank" rel="noopener noreffer">用VSCode的Remote-SSH连接Linux进行远程开发</a> 一文，后来发现我们没有 root 权限，就暂且搁置了和那边沟通让他们先试一试。我倒是顺便试了一试连电脑上的 WSL 和 Ubuntu 的虚拟机，感觉 Vscode 的 这个 Remote 插件确实是很好用，准备回头在 WSL 里面把 Texlive 2020 配置一下。</p>
<p>还有一点就是可以很方便的使用 WinSCP 在服务器和本地主机之间共享文件，还支持远程编辑，使得没有 Root 权限的我们使用就更加便利。</p>
<h2 id="安装-pytorch">安装 Pytorch</h2>
<p>首先我发现 Cuda 是装好的（不然我基本上装不了 Pytorch），装 Pytorch 最大的坑就是版本的问题，我这个 Cuda 是10.0，在国内的阿里源还是科大源都找不到对应的，还是最后使用默认的源下载了，幸好速度还不错。</p>
<h2 id="接下来计划">接下来计划</h2>
<p>有一个比较好的习惯是在 Conda 创建一个虚拟环境，然后在里面配置框架做自己的事情：</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash">conda create -n xx <span class="nv">python</span> <span class="o">=</span> 3.x <span class="c1"># 创建xx虚拟环境</span>
conda activate xx <span class="c1"># 激活</span>
conda deactivate <span class="c1"># 关闭</span>
</code></pre></div><p>接下来几天就准备跑一跑小型的 Bert 模型的 case ，然后学习下 Bert 框架的代码和其应用的方法。</p>
</div><div class="post-footer" id="post-footer">
    <div class="post-info">
        <div class="post-info-line">
            <div class="post-info-mod">
                <span>更新于 2020-06-30</span>
            </div>
            <div class="post-info-license"></div>
        </div>
        <div class="post-info-line">
            <div class="post-info-md"></div>
            <div class="post-info-share">
                <span></span>
            </div>
        </div>
    </div>

    <div class="post-info-more">
        <section class="post-tags"><i class="fas fa-tags fa-fw"></i>&nbsp;<a href="/tags/linux/">Linux</a>,&nbsp;<a href="/tags/vscode/">vscode</a></section>
        <section>
            <span><a href="javascript:void(0);" onclick="window.history.back();">返回</a></span>&nbsp;|&nbsp;<span><a href="/">主页</a></span>
        </section>
    </div>

    <div class="post-nav"><a href="/posts/%E7%94%B5%E5%8A%A8%E5%8C%96%E6%90%85%E5%8A%A8%E4%B8%80%E6%B1%A0%E6%98%A5%E6%B0%B4%E6%88%91%E7%9C%8B%E7%89%B9%E6%96%AF%E6%8B%89%E8%B7%83%E5%B1%85%E5%B8%82%E5%80%BC%E7%AC%AC%E4%B8%80/" class="prev" rel="prev" title="电动化搅动一池春水"><i class="fas fa-angle-left fa-fw"></i>电动化搅动一池春水</a>
            <a href="/posts/%E8%B0%88%E8%B0%88kmt%E5%92%8C%E4%B9%9D%E4%BA%8C%E5%85%B1%E8%AF%86/" class="next" rel="next" title="谈谈KMT和“九二共识&#34;">谈谈KMT和“九二共识&#34;<i class="fas fa-angle-right fa-fw"></i></a></div>
</div>
</article></div>
            </main><footer class="footer">
        <div class="footer-container"><div class="footer-line">由 <a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo 0.87.0">Hugo</a> 强力驱动 | 主题 - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt 0.2.10"><i class="far fa-kiss-wink-heart fa-fw"></i> LoveIt</a>
                </div><div class="footer-line"><i class="far fa-copyright fa-fw"></i><span itemprop="copyrightYear">2016 - 2021</span><span class="author" itemprop="copyrightHolder">&nbsp;<a href="/" target="_blank">辛载阳</a></span>&nbsp;|&nbsp;<span class="license"><a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a></span></div>
        </div>
    </footer></div>

        <div id="fixed-buttons"><a href="#" id="back-to-top" class="fixed-button" title="回到顶部">
                <i class="fas fa-arrow-up fa-fw"></i>
            </a><a href="#" id="view-comments" class="fixed-button" title="查看评论">
                <i class="fas fa-comment fa-fw"></i>
            </a>
        </div><link rel="stylesheet" href="/lib/katex/katex.min.css"><link rel="stylesheet" href="/lib/katex/copy-tex.min.css"><script type="text/javascript" src="/lib/smooth-scroll/smooth-scroll.min.js"></script><script type="text/javascript" src="/lib/autocomplete/autocomplete.min.js"></script><script type="text/javascript" src="/lib/algoliasearch/algoliasearch-lite.umd.min.js"></script><script type="text/javascript" src="/lib/lazysizes/lazysizes.min.js"></script><script type="text/javascript" src="/lib/clipboard/clipboard.min.js"></script><script type="text/javascript" src="/lib/katex/katex.min.js"></script><script type="text/javascript" src="/lib/katex/auto-render.min.js"></script><script type="text/javascript" src="/lib/katex/copy-tex.min.js"></script><script type="text/javascript" src="/lib/katex/mhchem.min.js"></script><script type="text/javascript">window.config={"code":{"copyTitle":"复制到剪贴板","maxShownLines":10},"comment":{},"math":{"delimiters":[{"display":true,"left":"$$","right":"$$"},{"display":true,"left":"\\[","right":"\\]"},{"display":false,"left":"$","right":"$"},{"display":false,"left":"\\(","right":"\\)"}],"strict":false},"search":{"algoliaAppID":"MAYVVVUE0B","algoliaIndex":"feiyuxiaoThu","algoliaSearchKey":"eb3e163b921c3d50a89091f127fe6d14","highlightTag":"em","maxResultLength":10,"noResultsFound":"没有找到结果","snippetLength":50,"type":"algolia"}};</script><script type="text/javascript" src="/js/theme.min.js"></script></body>
</html>
